<%--
    //Copyright 2010 http://tv4home.codeplex.com
    //This file is part of TV4Home.WebInterface.UI.
    //TV4Home.WebInterface.UI is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
    //TV4Home.WebInterface.UI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    //You should have received a copy of the GNU General Public License along with TV4Home.WebInterface.UI If not, see http://www.gnu.org/licenses/
     --%>

<%@ Page Language="C#" MasterPageFile="WebSiteMaster.Master" AutoEventWireup="true"
    CodeBehind="TVGuide.aspx.cs" Inherits="TV4Home.WebInterface.UI.TVGuide" %>

<%@ Register TagPrefix="CustomControls" Src="Controls/LoadingProgressControl.ascx"
    TagName="LoadingProgressControl" %>
<%@ Register TagPrefix="CustomControls" Src="Controls/TVGuideSingleRowControl.ascx"
    TagName="TVGuideSingleRowControl" %>
<%@ Register TagPrefix="CustomControls" Src="Controls/TVGuideSingleChannelDetailsControl.ascx"
    TagName="TVGuideSingleChannelDetailsControl" %>
<asp:Content ContentPlaceHolderID="CSSPlaceHolder" runat="server">
    <link href="style/TVGuide.css?nocache=1" rel="stylesheet" type="text/css" />
    <link href="GetTVProgramsSearchDescription.ashx" rel="search" title="<%$ Resources : GetTVProgramsSearchDescriptionASHXTitle %>"
        type="application/opensearchdescription+xml" runat="server" />
</asp:Content>
<asp:Content ContentPlaceHolderID="ScriptsPlaceHolder" runat="server">
    <script type="text/javascript" src="scripts/TVGuide.js?nocache=1"></script>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderOutsideUpdatePanel" runat="Server">
    <h1>
        <asp:Label ID="lblPageTitle" runat="server" Text="<%$ Resources : lblPageTitle_Text %>"></asp:Label>
    </h1>
    <div id="programShortInfoTooltip" class="TVGuideProgramInfoTooltip">
        <div id="programShortInfoTooltipContentWrap" class="TVGuideProgramInfoTooltipContentWrap">
        </div>
    </div>
    <div id="programInfoDialog" class="TVGuideProgramInfoDialog">
        <div id="programInfoDialogContentWrap" class="TVGuideProgramInfoDialogContentWrap">
        </div>
        <div id="programInfoDialogiFrameFixMask" class="TVGuideProgramInfoDialogiFrameFixMask">
        </div>
    </div>
    <div id="programInfoDialogBlanket" style="position: absolute; top: 0; left: 0; width: 100%;
        height: 100%; background-color: #789; display: none">
    </div>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderUpdatePanel" runat="Server">
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="AllChannelsView" runat="server">
            <div>
                <div style="float: left">
                    <asp:Label ID="lblGroupDescr" runat="server" Text="<%$ Resources : lblGroupDescr_Text %>"></asp:Label>
                    <asp:DropDownList ID="ddlChannelGroups" runat="server" OnSelectedIndexChanged="ddlChannelGroups_SelectedIndexChanged"
                        AutoPostBack="True">
                    </asp:DropDownList>
                    &nbsp;
                    <asp:Label ID="lblChannelsPerPageDescr" runat="server" Text="<%$ Resources : lblChannelsPerPageDescr_Text %>"></asp:Label>
                    <asp:DropDownList ID="ddlChannelsPerPage" runat="server" OnSelectedIndexChanged="ddlChannelsPerPage_SelectedIndexChanged"
                        AutoPostBack="True">
                        <asp:ListItem Value="5"></asp:ListItem>
                        <asp:ListItem Value="10"></asp:ListItem>
                        <asp:ListItem Value="15"></asp:ListItem>
                        <asp:ListItem Value="20"></asp:ListItem>
                        <asp:ListItem Value="30"></asp:ListItem>
                        <asp:ListItem Value="40"></asp:ListItem>
                        <asp:ListItem Value="60"></asp:ListItem>
                        <asp:ListItem Value="999999999" Text="<%$ Resources : dllChannelsPerPageListItemAll_Text %>"></asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div style="float: right; margin-right: 10px;">
                    <div style="float: right;">
                        <asp:Label ID="lblDateDescr" runat="server" Text="<%$ Resources : lblDateDescr_Text %>"></asp:Label>
                        <asp:HiddenField ID="HiddenFieldDate" OnValueChanged="HiddenFieldDate_ValueChanged"
                            runat="server" Value=" " />
                        <asp:Label ID="lblDate" runat="server" Text="-Date-" Style="cursor: pointer"></asp:Label>
                        ,&nbsp;
                        <asp:Label ID="lblTimeDescr" runat="server" Text="<%$ Resources : lblTimeDescr_Text %>"></asp:Label>
                        <asp:DropDownList ID="ddlCurrentTime" runat="server" OnSelectedIndexChanged="ddlCurrentTime_SelectedIndexChanged"
                            AutoPostBack="True">
                        </asp:DropDownList>
                    </div>
                    <br />
                    <br />
                    <div style="margin-top: -10px;">
                        <!-- This invisible textbox is needed so that the searchbox fires the correct event. More details: http://www.beansoftware.com/asp.net-tutorials/accept-enter-key.aspx -->
                        <input type="text" style="display: none" />
                        <asp:TextBox ID="txtSearch" runat="server" Style="float: right;" ToolTip="<%$ Resources : txtSearch_ToolTip %>"
                            Width="200px"></asp:TextBox>
                        <asp:ImageButton ID="imgSearch" runat="server" Style="float: right; margin-right: 5px;"
                            ImageUrl="style/images/TVGuide/Search.png" OnClick="imgSearch_Click" />
                    </div>
                </div>
            </div>
            <div>
                <br />
                <br />
                <br />
                <br />
                <div class="TVGuideTimeNavigationPanel">
                    <div class="TVGuideRefreshLinkPanel">
                        <asp:LinkButton ID="lnkRefresh" runat="server" OnClick="lnkRefresh_Click" Text="<%$ Resources : lnkRefresh_Text %>"></asp:LinkButton>
                    </div>
                    <div class="TVGuideTimeSelectionPanel">
                        <asp:Button ID="btnNavTimeLeft" CssClass="TVGuideNavTimeLeft" runat="server" Text="&lt;"
                            OnClick="btnNavTimeLeft_Click" />
                        <asp:Button ID="btnNavTimeRight" CssClass="TVGuideNavTimeRight" runat="server" Text="&gt;"
                            OnClick="btnNavTimeRight_Click" />
                    </div>
                </div>
                <div class="TVGuideStandardSpacing">
                </div>
                <div>
                    <asp:Panel ID="pnHoursSeperatorPanel" CssClass="TVGuideHoursSeperatorPanel" runat="server">
                    </asp:Panel>
                    <br />
                    <div class="TVGuideStandardSpacing">
                    </div>
                    <div id="TVGuidePrograms">
                        <asp:Repeater ID="RepeaterTVGuide" runat="server" OnItemDataBound="RepeaterTVGuide_ItemDataBound">
                            <ItemTemplate>
                                <CustomControls:TVGuideSingleRowControl ID="tvGuideSingleRow" runat="server" OnChannelClicked="SingleChannel_Clicked" />
                            </ItemTemplate>
                        </asp:Repeater>
                        <div class="TVGuideProgramPaging">
                            <asp:Repeater ID="RepeaterPaging" runat="server" OnItemCommand="RepeaterPaging_ItemCommand"
                                OnItemDataBound="RepeaterPaging_ItemDataBound">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkbtnPaging" runat="server" CommandArgument='<%# Eval("PageIndex") %>'
                                        CommandName="lnkbtnPaging" Text='<%# Eval("PageText") %>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:Repeater>
                        </div>
                    </div>
                </div>
            </div>
        </asp:View>
        <asp:View ID="SingleChannelView" runat="server">
            <asp:LinkButton ID="lnkBackToGuide" runat="server" Text="<%$ Resources : lnkBackToGuide_Text %>"
                OnClick="lnkBackToGuide_Click"></asp:LinkButton>
            <br />
            <br />
            <asp:Image ID="imgChannelLogo" runat="server" Visible="False" Width="150px" />
            <h3>
                <asp:Label ID="lblChannelName" runat="server" Text="-ChannelName-"></asp:Label>
                &nbsp;
                <asp:HyperLink ID="hlWatchChannel" runat="server" Text="<%$ Resources : hlWatchChannel_Text %>"
                    Visible="false" />
            </h3>
            <asp:Panel ID="panelSingleChannelContainer" runat="server" Height="200px">
                <div class="TVGuideSingleChannelGuidePanel" runat="server">
                    <h4>
                        <asp:Label ID="lblGuideFor" runat="server" Text="<%$ Resources : lblGuideFor_Text %>"></asp:Label>
                        <%=this.CurrentDateTime.ToLongDateString() %>:
                    </h4>
                    <CustomControls:TVGuideSingleChannelDetailsControl ID="tvGuideSingleChannel" runat="server" />
                </div>
                <div class="TVGuideSingleChannelInfoPanel">
                    <h4>
                        <asp:Label ID="lblSingleChannelChannelDetails" runat="server" Text="<%$ Resources : lblSingleChannelChannelDetails_Text %>"></asp:Label>
                    </h4>
                    <p>
                        <asp:Label ID="lblSingleChannelGroupDescr" runat="server" Text="<%$ Resources : lblSingleChannelGroupDescr_Text %>"></asp:Label>
                        <asp:Label ID="lblSingleChannelGroup" runat="server" Text="-Group-"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblSingleChannelFTADescr" runat="server" Text="<%$ Resources : lblSingleChannelFTADescr_Text %>"></asp:Label>
                        <asp:Label ID="lblSingleChannelFTA" runat="server" Text="-FreeToAir-"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblSingleChannelTimesWatchedDescr" runat="server" Text="<%$ Resources : lblSingleChannelTimesWatchedDescr_Text %>"></asp:Label>
                        <asp:Label ID="lblSingleChannelTimesWatched" runat="server" Text="Label"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblSingleChannelTotalTimeWatchedDescr" runat="server" Text="<%$ Resources : lblSingleChannelTotalTimeWatchedDescr_Text %>"></asp:Label>
                        <asp:Label ID="lblSingleChannelTotalTimeWatched" runat="server" Text="Label"></asp:Label>
                    </p>
                </div>
            </asp:Panel>
            <br />
        </asp:View>
        <asp:View ID="SearchResultsView" runat="server">
            <asp:LinkButton ID="lnkBackToGuideSearchResults" runat="server" Text="<%$ Resources : lnkBackToGuideSearchResults_Text %>"
                OnClick="lnkBackToGuideSearchResults_Click"></asp:LinkButton>
            <br />
            <br />
            <h3>
                <asp:Label ID="lblSearchResultsTitle" runat="server" Text="<%$ Resources : lblSearchResultsTitle_Text %>"></asp:Label>
                <asp:Label ID="lblSearchResultsQuery" runat="server" Text="<%$ Resources : lblSearchResultsQuery_Text %>"></asp:Label>
            </h3>
            <asp:HyperLink ID="hlConnectSearchToWin7" Visible="False" runat="server" NavigateUrl="~/GetTVProgramsSearchDescription.ashx"
                ToolTip="<%$ Resources : hlConnectSearchToWin7_ToolTip %>" ImageUrl="style/images/TVGuide/ConnectWin7Search.png"
                Style="vertical-align: middle;"></asp:HyperLink>
            <br />
            <br />
            <asp:Label ID="lblSearchResultsCount" runat="server" Text="0"></asp:Label>
            <asp:Label ID="lblSearchResultsFoundDescr" runat="server" Text="<%$ Resources : lblSearchResultsFoundDescr_Text %>"></asp:Label>
            <br />
            <br />
            <br />
            <asp:GridView ID="grvSearchResults" runat="server">
            </asp:GridView>
        </asp:View>
    </asp:MultiView>
</asp:Content>
